home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Hyper / Me-Mz / MH Power Scripts v1.3.cpt / MH Power Scripts v1.3 / card_4255.txt < prev    next >
Text File  |  1988-05-06  |  6KB  |  224 lines

  1. -- card: 4255 from stack: in.3
  2. -- bmap block id: 9835
  3. -- flags: 4000
  4. -- background id: 2663
  5. -- name: Click Select
  6.  
  7.  
  8. -- part 1 (field)
  9. -- low flags: 01
  10. -- high flags: 4000
  11. -- rect: left=285 top=31 right=137 bottom=327
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 3
  16. -- text size: 12
  17. -- style flags: 256
  18. -- line height: 13
  19. -- part name: Click select 1
  20. ----- HyperTalk script -----
  21. on copyright
  22.  
  23.   -- Click Select, Copyright by Mac Help Co., January 1988
  24.   -- by Chris Hostetter, Mac Help Co., 1800 East Market Street
  25.   -- Long Beach, CA  90805, (213) 428-7414
  26.   --      The script for this button is copyrighted and may not be
  27.   --      used without the written permission of the author (above).
  28.  
  29. end copyright
  30.  
  31.  
  32. on mouseUp
  33.   Global ThisItem, ThisLine, ThisField
  34.  
  35.   --  NOTE: THIS BUTTON CAN ALSO USE A HILITER BUTTON.  SIMPLY CREATE
  36.   -- A NEW BUTTON ON THE SAME CARD OR BACKGROUND THAT THIS FIELD IS ON.
  37.   -- NAME THE BUTTON 'HILIGHTER' AND SET THE BUTTON TO TRANSPARENT
  38.   -- put false into UseHilighter (below) if you don't want a hilighter
  39.  
  40.   put True into UseHilighter
  41.  
  42.   set numberformat to 0
  43.   put the clickLoc into ThisMouseLoc
  44.   set cursor to 4
  45.  
  46.   put the name of the target into WhatField
  47.   put first word of WhatField into StackLocation
  48.  
  49.   put the rect of whatField into FieldRect
  50.   put item 1 of FieldRect into X   -- Left of Rect
  51.   put item 2 of FieldRect into Y   -- Top of Rect
  52.   put item 3 of FieldRect into XX  -- Right of Rect
  53.   put item 4 of FieldRect into YY  -- Bottom of Rect
  54.  
  55.   put (YY - Y) / the textheight of whatField into TotalZones
  56.   put (YY - Y) / TotalZones into ZoneDepth
  57.   put item 2 of ThisMouseLoc - Y into MouseDepth
  58.   put the trunc of ((MouseDepth / ZoneDepth) + 1) into whichZone
  59.  
  60.   if the style of whatField is "Scrolling" then
  61.     put the scroll of whatField / the textHeight of whatField into HiddenLines
  62.   else
  63.     put 0 into HiddenLines
  64.   end if
  65.   put the round of HiddenLines into HiddenLines
  66.   put whichZone + HiddenLines into ThisLine
  67.   do "put line" && ThisLine && "of" && whatField && "into ThisItem"
  68.  
  69.  
  70.   if UseHilighter is true then
  71.     --MOVE HILIGHTER BUTTON TO PROPER ZONE
  72.     put Y + ((whichZone-1)*ZoneDepth) into ButY
  73.     put the trunc of ButY into ButY
  74.     put the trunc of (ButY+ZoneDepth) into ButYY
  75.     if StackLocation is "Card" then
  76.       if the style of whatField is "Scrolling" then
  77.         set the rect of Card button "Hilighter" to X+1,ButY+1,XX-17,ButYY-1
  78.       else
  79.         set the rect of Card button "Hilighter" to X+1,ButY+1,XX-1,ButYY-1
  80.       end if
  81.       set the hilite of Card button "Hilighter" to true
  82.       show Card button "Hilighter"
  83.       Hide Card button "Hilighter"
  84.     else
  85.       if the style of whatField is "Scrolling" then
  86.         set the rect of background button "Hilighter" to X+1,ButY+1,XX-17,ButYY-1
  87.       else
  88.         set the rect of background button "Hilighter" to X+1,ButY+1,XX-1,ButYY-1
  89.       end if
  90.       set the hilite of background button "Hilighter" to true
  91.       show background button "Hilighter"
  92.       Hide background button "Hilighter"
  93.     end if
  94.   end if
  95.  
  96.   -- Do something to selected line
  97.   if ThisItem is empty then
  98.     -- Put whatever you want into the field when it is clicked
  99.     put "XXX" into PutStuff
  100.     do "put" && PutStuff && "into line" && ThisLine && "of" && whatField
  101.   else
  102.     do "put empty into line" && ThisLine && "of" && whatField
  103.   end if
  104.   -- end doing something to selected line
  105.  
  106. end mouseUp
  107.  
  108.  
  109.  
  110. -- part 2 (button)
  111. -- low flags: 80
  112. -- high flags: 4000
  113. -- rect: left=286 top=110 right=121 bottom=326
  114. -- title width / last selected line: 0
  115. -- icon id / first selected line: 0 / 0
  116. -- text alignment: 1
  117. -- font id: 0
  118. -- text size: 12
  119. -- style flags: 0
  120. -- line height: 16
  121. -- part name: Hilighter
  122.  
  123.  
  124. -- part 3 (field)
  125. -- low flags: 00
  126. -- high flags: 4000
  127. -- rect: left=328 top=31 right=137 bottom=493
  128. -- title width / last selected line: 0
  129. -- icon id / first selected line: 0 / 0
  130. -- text alignment: 0
  131. -- font id: 3
  132. -- text size: 12
  133. -- style flags: 0
  134. -- line height: 13
  135. -- part name: Click select 1
  136.  
  137.  
  138. -- part 4 (button)
  139. -- low flags: 00
  140. -- high flags: A005
  141. -- rect: left=290 top=146 right=168 bottom=498
  142. -- title width / last selected line: 0
  143. -- icon id / first selected line: 0 / 0
  144. -- text alignment: 1
  145. -- font id: 0
  146. -- text size: 12
  147. -- style flags: 0
  148. -- line height: 16
  149. -- part name: SHOW the Hilighter Button
  150. ----- HyperTalk script -----
  151. on mouseUp
  152.   put the name of the target into ThisName
  153.   if the visible of card button "Hilighter" is true then
  154.     hide card button "Hilighter"
  155.     set the name of ThisName to "SHOW the Hilighter Button"
  156.   else
  157.     show card button "Hilighter"
  158.     set the name of ThisName to "HIDE the Hilighter Button"
  159.   end if
  160.  
  161. end mouseUp
  162.  
  163.  
  164.  
  165. -- part 5 (field)
  166. -- low flags: 01
  167. -- high flags: 0004
  168. -- rect: left=265 top=20 right=35 bottom=325
  169. -- title width / last selected line: 0
  170. -- icon id / first selected line: 0 / 0
  171. -- text alignment: 1
  172. -- font id: 3
  173. -- text size: 9
  174. -- style flags: 0
  175. -- line height: 12
  176. -- part name: 
  177. ----- HyperTalk script -----
  178. on mouseUp
  179.   edit script of card field "Click Select 1"
  180. end mouseUp
  181.  
  182.  
  183. -- part contents for background part 8
  184. ----- text -----
  185. Card 10 of 20
  186.  
  187. -- part contents for card part 1
  188. ----- text -----
  189.  
  190. XXX
  191.  
  192.  
  193. XXX
  194.  
  195. XXX
  196. XXX
  197.  
  198. -- part contents for card part 3
  199. ----- text -----
  200. Eggs
  201. Butter
  202. Flower
  203. Salt
  204. Pepper
  205. This Item
  206. This Item
  207. This Item
  208.  
  209.  
  210. -- part contents for background part 9
  211. ----- text -----
  212. CLICK SELECT
  213.  
  214. When you click on the field, it automatically puts XXX into the field to mark it.
  215.  
  216. This type of marker is very useful because it is a field, and if used on the background, it will work on every card and retain its own settings from card to card. 
  217.  
  218. You can resize this field to hold only one item, or as many as needed.
  219.  
  220. Currently, the script is set to put XXX into the line that is clicked on, but you can change it to whatever you want.
  221.  
  222. -- part contents for card part 5
  223. ----- text -----
  224. See Script